package com.ac.conf;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@SuppressWarnings({ "rawtypes", "unchecked" })
@Configuration
public class FileFilterConfig {
	@Bean
	public FilterRegistrationBean myFilterRegistrationBean() {
		FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new FileFilter());

		// 添加过滤路径
		filterRegistrationBean.addUrlPatterns("/static_file/upload/*");
		return filterRegistrationBean;
	}

}
